﻿<Application x:Class="Dashboard.Shell.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:app="clr-namespace:Dashboard.Shell"
             xmlns:auth="clr-namespace:AuthenticationService.Client;assembly=AuthenticationService.Client"
             xmlns:appsvc="clr-namespace:System.Windows.Ria.ApplicationServices;assembly=System.Windows.Ria"
             xmlns:prism="clr-namespace:Microsoft.Practices.Composite.Presentation.Regions;assembly=Microsoft.Practices.Composite.Presentation">

    <Application.Resources>
        <Style x:Key="ContentControlRegionStyle" TargetType="ContentControl">
            <Setter Property="Foreground" Value="#FF000000"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ContentControl">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Row="0" CornerRadius="4,4,0,0" BorderBrush="#FF28332D" BorderThickness="1" VerticalAlignment="Top">
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0.5,-0.601" StartPoint="0.5,1.601">
                                            <GradientStop Color="#FF303F2D"/>
                                            <GradientStop Color="#FFD7DED6" Offset="1"/>
                                            <GradientStop Color="#FF252A49" Offset="0.4869999885559082"/>
                                        </LinearGradientBrush>
                                    </Border.Background>
                                    <!--Should really bind to RegionManager.RegionName but can't template bind to attached properties-->
                                    <TextBlock Text="{TemplateBinding Name}" TextWrapping="Wrap" HorizontalAlignment="Center" Foreground="#FFD9E3CF" FontWeight="Normal" FontFamily="Portable User Interface" FontSize="12" VerticalAlignment="Center"/>
                                </Border>
                                <ContentPresenter Grid.Row="1" Cursor="{TemplateBinding Cursor}" ContentTemplate="{TemplateBinding ContentTemplate}" />
                            </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Application.Resources>

    <Application.ApplicationLifetimeObjects>
        <!-- 
           We need to add the generated WebContext to the application lifetime objects.
           Also, we'll use this opportunity to specify the type of authentication we're
           using and the domain context that was generated from our authentication
           domain service.
        -->
        <auth:WebContext>
            <auth:WebContext.Authentication>
                <appsvc:FormsAuthentication/>
            </auth:WebContext.Authentication>
        </auth:WebContext>
    </Application.ApplicationLifetimeObjects>

</Application>
